package com.senseuni.da.http

import io.reactivex.Observable
import okhttp3.ResponseBody
import retrofit2.http.*


interface ApiService {

    @GET("https://api.ipify.org?format=json")
    fun getIp():Observable<IpResponse>

    @POST("/lumx/app-device/registry")
    fun registry(@Body body: BaseRequest): Observable<BaseResponse<Any>>

    @POST("/lumx/app-device/get-device-env")
    fun deviceEnv(@Body body: BaseRequest): Observable<BaseResponse<DeviceEnvBean>>

    @POST("/lumx/app-device/get-device-info")
    fun deviceInfo(@Body body: BaseRequest): Observable<BaseResponse<DeviceInfoBean>>

    @POST("/lumx/app-device/get-upgrade")
    fun checkUpgrade(@Body body: BaseRequest): Observable<BaseResponse<UpgradeBean>>

    @POST("/lumx/app-device/getWeatherInfo")
    fun getWeatherInfo(@Body body: BaseRequest): Observable<BaseResponse<WeatherInfo>>

    @POST("/lumx/app-device/getDateInfo")
    fun getDateInfo(@Body body: BaseRequest): Observable<BaseResponse<DateInfo>>

    @POST("/lumx/app-device/upload-device-log")
    suspend fun uploadDeviceLog(@Body body: AppLogRequest): BaseResponse<Any>

    @Streaming
    @GET
    fun downloadFile(@Url url: String): Observable<ResponseBody>
}